package com.joker.userExam.controller.questionManage;

import com.joker.userExam.model.SubjectOneQuestion;
import com.joker.userExam.service.ISubjectOneQuestionManage;
import com.joker.userExam.utils.ResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author 李杰
 * @date 2021/5/6 - 21:41
 */
@CrossOrigin(origins = "http://localhost:3000")
@RestController
@RequestMapping("/subjectOneManage")
public class SubjectOneQuestionManage {
    @Autowired
    ISubjectOneQuestionManage subjectOneQuestionManage;

    @PostMapping("/saveSubjectOneQuestion")
    public ResultUtil saveSubjectOneQuestion(@RequestBody SubjectOneQuestion oneQuestion) {
        return subjectOneQuestionManage.saveSubjectOneQuestion(oneQuestion);
    }

    @GetMapping("/deleteSubjectOneQuestion")
    public ResultUtil deleteSubjectOneQuestion(@RequestParam Integer id) {
        return subjectOneQuestionManage.deleteSubjectOneQuestion(id);
    }

    @PostMapping("/updateSubjectOneQuestion")
    public ResultUtil updateSubjectOneQuestion(@RequestBody SubjectOneQuestion oneQuestion) {
        return subjectOneQuestionManage.updateSubjectOneQuestion(oneQuestion);
    }

    @GetMapping("queryAllSubjectOneQuestion")
    public ResultUtil queryAllSubjectOneQuestion() {
        return subjectOneQuestionManage.queryAllSubjectOneQuestion();
    }

    @PostMapping("/querySubjectOneQuestionByCondition")
    ResultUtil querySubjectOneQuestionByCondition(@RequestBody SubjectOneQuestion oneQuestion) {
        return subjectOneQuestionManage.querySubjectOneQuestionByCondition(oneQuestion);
    }

}
